package cl.uchile.sketchpad.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cl.uchile.sketchpad.persistance.dao.SubjectDao;
import cl.uchile.sketchpad.persistance.model.Subject;

@Service
public class SubjectServiceImpl implements SubjectService {
	
	@Autowired
	private SubjectDao subjectDao;

	@Override
	@Transactional(readOnly = true)
	public List<Subject> getSubjects() {
		return subjectDao.getAll();
	}
	
	@Override
	@Transactional(readOnly = true)
	public Subject findById(Integer id) {
		return this.subjectDao.findById(id);
	}
	
}
